#include"comm.h"
#include<iostream>

using namespace std;
int main()
{
    int fd = open(FILE_NAME, O_WRONLY);
    if(fd < 0)
    {
        perror("client open fail!");
        return 1;
    }

    char buff[128];
    while(1)
    {
        buff[0] = '\0';
        cout << "please enter#" << endl;
        fflush(stdout);
        ssize_t s = read(0, buff, sizeof(buff)-1);
        if(s > 0)
        {
            buff[s-1] = '\0';
            write(fd, buff, strlen(buff)-1);
        }
    }
    close(fd);
    return 0;
}